<!-- 案例详情组件 -->
<template>
    <div class="case-content">
        <h5>
            <span :title="caseInfo.exampleName">{{FILTER_FORMATER.wordNum(caseInfo.exampleName, 34)}}</span>
            <nuxt-link :to="`/qiao/s/detail/${caseInfo.productid}`" :title="caseInfo.productName">
                {{FILTER_FORMATER.wordNum(caseInfo.productName, 10)}}
            </nuxt-link>
        </h5>
        <div v-html="caseInfo.exampleInfo" class="cs-ct"></div>
        <p v-if="caseInfo.exampleLabel" class="cs-span">
            <span v-for="(litem, lindex) in caseInfo.exampleLabel.split(',')" :key="lindex">{{litem}}</span>
        </p>
        <template v-if="caseInfo.examplePictureUrl">
            <div v-for="(itemg, indexg) in parseImgUrl(caseInfo.examplePictureUrl)" :key="indexg" class="cs-img">
                <img :src="serFileUrl + itemg" alt="">
            </div>
        </template>
    </div>
</template>

<script lang="ts">
import {
    Vue,
    Prop,
    Component
} from 'nuxt-property-decorator'
import {serFileUrl} from '~/../config/server.url.conf'
@Component({
    name: 'caseDetail'
})
export default class CaseDetail extends Vue {
    serFileUrl: string = serFileUrl
    @Prop({
        type: Object,
        default: () => {
            return {}
        }
    })
    caseInfo!: any
    parseImgUrl (str: string) {
        return str.split(',')
    }
}
</script>

<style lang="scss" scoped>
    .case-content{
        background-color: #fff;
        padding: 30px 68px;
        border-radius: 6px;
        h5{
            font-size: 24px;
            line-height: 38px;
            a{
                font-size: 14px;
                color: #333;
                float: right;
                &:hover{
                    color: $blue;
                }
            }
        }
        .cs-ct{
            padding: 10px 0;
            line-height: 24px;
            font-size: 14px;
            color: #666;
        }
        .cs-span{
            font-size: 12px;
            color: #999;
            padding: 10px 0;
            span{
                padding: 4px 14px;
                border: 1px solid #e0e0e0;
                border-radius: 2px;
                margin-right: 16px;
            }
        }
        .cs-img{
            text-align: center;
            img {
                max-width: 100%;
                width: auto;
                margin-top: 20px;
            }
        }
    }
</style>

<style lang="scss">
    .case-content{
        .cs-ct{
            div{
                max-width: 100% !important;
            }
            img{
                max-width: 100%;
                width: auto;
                height: auto;
                display: block;
                margin: 0 auto;
            }
        }
    }
</style>
